<template>
  <div>
    <el-button :type="form.type" :disabled="form.disabled">{{ form.name }}</el-button>
  </div>
</template>
<script setup>
import {  watch, defineProps, reactive } from "vue";
let form = reactive({
  disabled: false,
  name: "按钮",
  type: "primary",
});

const props = defineProps({
  data: Object,
});
watch(
  props,
  (newValue) => {
    if (Object.keys(newValue.data).length!==0) {
       form = {
      ...newValue.data.options,
    };
    }
  },
  { deep: true, immediate: true }
);
</script>
